load("//packages/zone.js:tools.bzl", "copy_to_bin", "ts_project")

package(default_visibility = ["//visibility:public"])

exports_files(glob([
    "**/*",
]))

copy_to_bin(
    name = "files",
    srcs = [
        "browser/rollup-canvas.ts",
        "browser/rollup-message-port.ts",
        "browser/rollup-shadydom.ts",
        "browser/rollup-webapis-media-query.ts",
        "browser/rollup-webapis-notification.ts",
        "browser/rollup-webapis-resize-observer.ts",
        "browser/rollup-webapis-rtc-peer-connection.ts",
        "browser/rollup-webapis-user-media.ts",
        "common/rollup-error-rewrite.ts",
        "common/rollup-fetch.ts",
        "extra/rollup-bluebird.ts",
        "extra/rollup-cordova.ts",
        "extra/rollup-electron.ts",
        "extra/rollup-jsonp.ts",
        "extra/rollup-socket-io.ts",
        "jasmine/rollup-jasmine.ts",
        "mix/rollup-mix.ts",
        "mocha/rollup-mocha.ts",
        "node/rollup-main.ts",
        "rxjs/rollup-rxjs.ts",
        "testing/async-testing.ts",
        "testing/fake-async.ts",
        "testing/rollup-promise-testing.ts",
        "testing/rollup-zone-testing.ts",
        "zone-spec/rollup-long-stack-trace.ts",
        "zone-spec/rollup-proxy.ts",
        "zone-spec/rollup-sync-test.ts",
        "zone-spec/rollup-task-tracking.ts",
        "zone-spec/rollup-wtf.ts",
    ],
)

ts_project(
    name = "zone_d_ts",
    srcs = [
        "zone.api.extensions.ts",
        "zone.configurations.api.ts",
        "zone.ts",
        "zone-impl.ts",
    ],
)

ts_project(
    name = "lib",
    srcs = glob(
        ["**/*.ts"],
        exclude = [
            "zone.ts",
            "zone-impl.ts",
            "zone.api.extensions.ts",
            "zone.configurations.api.ts",
        ],
    ),
    deps = [
        ":zone_d_ts",
        "//packages/zone.js:node_modules/@types/jasmine",
        "//packages/zone.js:node_modules/@types/node",
        "//packages/zone.js:node_modules/rxjs",
    ],
)
